/***************************************************************
 *  Copyright (c) 2007 by GroupMe! Team (www.groupme.net)
 *  All rights reserved
 *
 *  This file is part of the GroupMe! Project. You can utilize
 *  software of the GroupMe! project under the terms of the 
 *  GNU Lesser General Public License as published by the
 *  Free Software Foundation in version 2.1.
 * 
 *  The GNU Lesser General Public License can be found at:
 *  http://www.gnu.org/licenses/lgpl.html
 *
 *  This copyright notice MUST APPEAR in all copies of the file!
 ***************************************************************/
package net.groupme.model;

import java.util.Collection;

import net.groupme.exceptions.DeleteFailedException;
import net.groupme.exceptions.InsertFailedException;
import net.groupme.exceptions.UpdateFailedException;

/**
 * This interface defines a GroupVisualization object in the GroupMe! project. A
 * GroupVisualization is a collection of ResourceVisualizations
 * {@link net.groupme.model.ResourceVisualization}. It has a Style
 * {@link net.groupme.model.Style} which defines its general look and can be
 * used by different Users {@link net.groupme.model.User} with different roles.
 * 
 * created on 15.04.2007
 * 
 * @author Mischa Frank <a
 *         href="mailto:code@planetfrank.net">code@planetfrank.net</a>
 * @author Patrick Siehndel <a
 *         href="mailto:patrick.siehndel@gmx.de">patrick.siehndel@gmx.de</a>
 * 
 * @version 0.1
 * 
 */
public interface GroupVisualization extends Identifiable {

	/**
	 * This method adds a ResourceVisualization to the GroupVisualization.
	 * 
	 * @param resourceVisualization
	 * @throws UpdateFailedException 
	 */
	public void addResourceVisualization(
			ResourceVisualization resourceVisualization) throws UpdateFailedException;

	/**
	 * This method adds a User with a given role to the GroupVisualization
	 * 
	 * @param role
	 * @param user
	 * @throws InsertFailedException 
	 */
	public void addUser(String role, User user) throws InsertFailedException;

	/**
	 * This method returns the Group to which the GroupVisualization is assigned
	 * to.
	 * 
	 * @return Group to which the GroupVisualization is assigned to.
	 */
	public Group getGroup();

	/**
	 * This method returns the name of the Visualization.
	 * 
	 * @return name
	 */
	public String getName();

	/**
	 * This method returns all ResourceVisualizations of the GroupVisualization.
	 * 
	 * @return Collection of ResourceVisualizations of the GroupVisualization
	 */
	public Collection<ResourceVisualization> getResourceVisualizations();

	/**
	 * This method returns the Style of the GroupVisualization.
	 * 
	 * @return Style of the GroupVisualization
	 */
	public Style getStyle();

	/**
	 * This method returns the Url of the thumbnail
	 * 
	 * @return a String containing the Url of the Thumbnail
	 */
	public String getThumbnail();
	
	/**
	 * This method returns the Users which use the GroupVisualization and have a
	 * given role.
	 * 
	 * @param role
	 * @return Collection of Users using the GroupVisualization with a given
	 *         role.
	 */
	public Collection<User> getUser(String role);

	/**
	 * This method returns all Users which use the GroupVisualization.
	 * 
	 * @return Collection of Users using the GroupVisualization
	 */
	public Collection<User> getUsers();

	/**
	 * This method removes a ResourceVisualization from the GroupVisualization.
	 * 
	 * @param resourceVisualization
	 * @throws DeleteFailedException 
	 */
	public void removeResourceVisualization(
			ResourceVisualization resourceVisualization) throws DeleteFailedException;

	/**
	 * This method removes a User from the GroupVisualization.
	 * 
	 * @param user
	 * @throws DeleteFailedException 
	 */
	public void removeUser(User user) throws DeleteFailedException;

	/**
	 * This method sets the Group to which the GroupVisualization should be
	 * assigned to.
	 * 
	 * @param group
	 */
	public void setGroup(Group group);

	/**
	 * THis method sets the name of the Visualization.
	 * 
	 * @param name
	 * @throws UpdateFailedException 
	 */
	public void setName(String name) throws UpdateFailedException;

	/**
	 * This method sets the Style of the GroupVisualization.
	 * 
	 * @param style
	 * @throws UpdateFailedException 
	 */
	public void setStyle(Style style) throws UpdateFailedException;
	
	/**
	 * This method sets the Thumbnail of the GroupVisualization.
	 * 
	 * @param the URL of the Thumbnail
	 * @throws UpdateFailedException 
	 */
	public void setThumbnail(String url)throws UpdateFailedException;

}
